package com.tm.d5_block;
/**
 * 2024/5/17 Cjj Student  15:52 static应用代码块
 */
public class Student {
    static int number=80;
    static String schoolName;

    //静态代码块
    static {
        System.out.println("静态代码块执行了");
        schoolName="宋门关";
    }

    //实例代码块
    {
        System.out.println("实例代码块执行了！");
        System.out.println("有人创建对象了"+this);
    }

    public Student(){
        System.out.println("无参数构造器执行了~~");
    }

    public Student(String name){
        System.out.println("有参数构造器执行了~~");
    }
}
